import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '科目大类',
    align:"center",
    sorter: true,
    dataIndex: 'kmType_dictText'
   },
   {
    title: '试题分类',
    align:"center",
    sorter: true,
    dataIndex: 'stType_dictText'
   },
   {
    title: '难易程度',
    align:"center",
    sorter: true,
    dataIndex: 'stStar_dictText'
   },
   {
    title: '试题内容',
    align:"center",
    dataIndex: 'stTitle'
   },
   {
    title: '可选答案A',
    align:"center",
    dataIndex: 'stSelectA'
   },
   {
    title: '可选答案B',
    align:"center",
    dataIndex: 'stSelectB'
   },
   {
    title: '可选答案C',
    align:"center",
    dataIndex: 'stSelectC'
   },
   {
    title: '可选答案D',
    align:"center",
    dataIndex: 'stSelectD'
   },
   {
    title: '可选答案E',
    align:"center",
    dataIndex: 'stSelectE'
   },
   {
    title: '可选答案F',
    align:"center",
    dataIndex: 'stSelectF'
   },
   {
    title: '试题答案',
    align:"center",
    dataIndex: 'stAnswer'
   },
   {
    title: '试题说明',
    align:"center",
    dataIndex: 'stNotes'
   },
   {
    title: '当前状态',
    align:"center",
    dataIndex: 'status_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "科目大类",
      field: 'kmType',
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"km_type"
      },
      //colProps: {span: 6},
 	},
	{
      label: "试题分类",
      field: 'stType',
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"st_type"
      },
      //colProps: {span: 6},
 	},
	{
      label: "难易程度",
      field: 'stStar',
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"st_star"
      },
      //colProps: {span: 6},
 	},
	{
      label: "试题内容",
      field: 'stTitle',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "当前状态",
      field: 'status',
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"status"
      },
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '科目大类',
    field: 'kmType',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"km_type"
     },
  },
  {
    label: '试题分类',
    field: 'stType',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"st_type"
     },
  },
  {
    label: '难易程度',
    field: 'stStar',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"st_star"
     },
  },
  {
    label: '试题内容',
    field: 'stTitle',
    component: 'Input',
  },
  {
    label: '可选答案A',
    field: 'stSelectA',
    component: 'Input',
  },
  {
    label: '可选答案B',
    field: 'stSelectB',
    component: 'Input',
  },
  {
    label: '可选答案C',
    field: 'stSelectC',
    component: 'Input',
  },
  {
    label: '可选答案D',
    field: 'stSelectD',
    component: 'Input',
  },
  {
    label: '可选答案E',
    field: 'stSelectE',
    component: 'Input',
  },
  {
    label: '可选答案F',
    field: 'stSelectF',
    component: 'Input',
  },
  {
    label: '试题答案',
    field: 'stAnswer',
    component: 'Input',
  },
  {
    label: '试题说明',
    field: 'stNotes',
    component: 'Input',
  },
  {
    label: '当前状态',
    field: 'status',
    defaultValue: "1",
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"status"
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  kmType: {title: '科目大类',order: 0,view: 'list', type: 'string',dictCode: 'km_type',},
  stType: {title: '试题分类',order: 1,view: 'list', type: 'string',dictCode: 'st_type',},
  stStar: {title: '难易程度',order: 2,view: 'list', type: 'string',dictCode: 'st_star',},
  stTitle: {title: '试题内容',order: 3,view: 'text', type: 'string',},
  stSelectA: {title: '可选答案A',order: 4,view: 'text', type: 'string',},
  stSelectB: {title: '可选答案B',order: 5,view: 'text', type: 'string',},
  stSelectC: {title: '可选答案C',order: 6,view: 'text', type: 'string',},
  stSelectD: {title: '可选答案D',order: 7,view: 'text', type: 'string',},
  stSelectE: {title: '可选答案E',order: 8,view: 'text', type: 'string',},
  stSelectF: {title: '可选答案F',order: 9,view: 'text', type: 'string',},
  stAnswer: {title: '试题答案',order: 10,view: 'text', type: 'string',},
  stNotes: {title: '试题说明',order: 11,view: 'text', type: 'string',},
  status: {title: '当前状态',order: 12,view: 'list', type: 'string',dictCode: 'status',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}